﻿//对app修改封闭的函数集合 by 爱琴海族 25522352 utf-8
window.onerror = function(){ 
return true; 
} 


function followButton(){      //关注微信号弹出层打开
document.getElementById("footWx").style.display="block";
scrollControl(0);
}

function closeFollowButton(){     //关注微信号弹出层关闭
document.getElementById("footWx").style.display="none";
scrollControl(1);
}

function scrollControl(dt){   //控制页面层的滚动,dt=0关闭滚动 不为0则可以滚动。
var jinzhi=eval(dt);
document.addEventListener("touchmove",function(e){
if(jinzhi==0){
e.preventDefault();
e.stopPropagation();
}},false);
}

//猜你喜欢ajax

function goDetil(url){
window.location.href=url;
return;
}	

function guesslike(ajaxurl){

$.ajax({
             type:"GET",
             url:ajaxurl,
             dataType:"json",
             success: function(data){
			if(data.status){
			   $(".guesslike").css("display","block");
			   $(".aboutProduct").css("display","table");
			  var abouthtml =''; 
			            $.each(data.list,function(key,val){
				          abouthtml += "<li onclick=goDetil('"+data.list[key].url+"')><img src='"+data.list[key].gimg+"'><h3>"+data.list[key].gname+"</h3><span>"+data.list[key].gprice+"</span></li>";
                         });
                         $('.aboutProduct').html(abouthtml);
					     var abli=$(".aboutProduct li");
						 if(abli.length==9){abli.eq(3).addClass("ml0");abli.eq(6).addClass("ml0");}else{abli.eq(3).addClass("ml0");}
						}
						 
                      },error:function(XMLHttpRequest,textStatus,errorThrown){
					  console.log("猜你喜欢-XMLHttpRequest:"+XMLHttpRequest);
					  console.log("猜你喜欢-textStatus:"+textStatus);
					  console.log("猜你喜欢-errorThrown:"+errorThrown);
					  }
         }); 
}// guesslike

    